package com.google.gwt.gfx.client.graphics;

import com.google.gwt.gfx.client.overlays.AnchorOverlay;
import com.google.gwt.gfx.client.style.FillStyle;
import com.google.gwt.gfx.client.style.StrokeStyle;
import com.google.gwt.user.client.Element;

public abstract class Ellipse extends SimpleGraphic implements AnchorOverlay {

	public static Ellipse get() {
		return GraphicFactory.DEFAULT.createEllipse();
	}

	private FillStyle fillRef;

	private StrokeStyle strokeRef;

	protected Ellipse(Element element) {
		super(element);

		fillRef = GraphicFactory.DEFAULT.createFillOf(this);
		strokeRef = GraphicFactory.DEFAULT.createStrokeOf(this);
	}

	public FillStyle fill() {
		return fillRef;
	}

	public int getRadius() {
		return getRadiusWidth();
	}

	public abstract int getRadiusHeight();

	public abstract int getRadiusWidth();

	public void setRadius(int radius) {
		setRadiusWidth(radius);
		setRadiusHeight(radius);
	}

	public abstract void setRadiusHeight(int radiusY);

	public abstract void setRadiusWidth(int radiusX);

	public StrokeStyle stroke() {
		return strokeRef;
	}

}
